﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dukou.Caching
{
    /// <summary>
    /// 分类缓存接口
    /// </summary>
    /// <typeparam name="TKey">键类型</typeparam>
    /// <typeparam name="TValue">值类型</typeparam>
    public interface ICategoryCache<TKey, TValue>
    {
        /// <summary>
        /// 添加缓存内容
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        void Add(TKey key, TValue value);

        /// <summary>
        /// 获取缓存的内容
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        TValue Get(TKey key);

        /// <summary>
        /// 移除指定的缓存内容
        /// </summary>
        /// <param name="key"></param>
        void Remove(TKey key);

        /// <summary>
        /// 清除整个分类缓存
        /// </summary>
        void Clear();
    }
}
